package com.work.controller;

import com.work.service.ExcelService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;

/**
 * @author: YanL
 * @createTime: 2023-01-03  10:29
 * @version: 1.0.0
 * @description:
 */
@RestController
@RequestMapping("/v1/job/")
@Slf4j
public class ExcelController {

  /**
   * excel导出Service层
   */
  @Autowired
  private ExcelService excelService;

  /**
   * excel导出
   *
   * @param response http响应
   */
  @GetMapping("/export")
  public void exportExcel(HttpServletResponse response) {
    log.info("导出excel");
    excelService.exportExcel(response);
  }
}
